package 运输配货系统;

import java.util.Scanner;

public class User {

	int orderNumber;
	String name;
int []number=new int[11];
int []id=new int[7];
	
	Address address;
	int [][]orderID=new int[100][5] ;
	public User() {
		System.out.println("请按顺序输入 姓名 电话号码 用户id后 再输入地址 ");
		Scanner scanner=new Scanner(System.in);
		name=scanner.next();
	
			String number1=scanner.next();
	if(number1.length()==11)
	{
		for(int i=0;i<number1.length();i++) {
			int j=number1.charAt(i)-48;
			if(j>=0&&j<10) {
				number[i]=j;
			}
			else {
				System.out.println("手机号输入格式错误（非数字）");
				
			     }
				
			
		}
	}
	else {
		System.out.println("手机号输入格式错误(长度)");
	     }
		
			String id1=scanner.next();
			
			if(id1.length()==7)
			{
				
				for(int i=0;i<id1.length();i++) {
					int j=id1.charAt(i)-48;
					if(j>=0&&j<10) {
						id[i]=j;
					}
					else {
						System.out.println("id号输入格式错误（非数字）");
						
					     }
						
					
				}
			}
			else {
				System.out.println("id号输入格式错误(长度)");
			}
			
		address=new Address();
	}
	
	
	
	public static String toString(int [] a) {
		String s="";
		
		for(int i=0;i<a.length;i++)
			s=s+a[i];
		return s;
	}
	
	public String getOrderID() {
		String s="";
		for(int i=0;i<orderNumber;i++)
		{ s =s+toString(orderID[i]);
		s=s+" ";
		
		}
		return s;
	}
	public void setOrderID(int a[],int n) {
		
		
		for(int j=0;j<a.length;j++)
		{
			this.orderID[n][j]=a[j];
		}
	}
	public String getId() {
		return toString(id);
	}
	public void setId(int a[]) {
		for(int i=0;i<a.length;i++)
		{
			this.id[i]=a[i];
		}
	}
	public String getNumber() {
		return toString(number);
	}
	
	public void setNumber(int a[]) {
		for(int i=0;i<a.length;i++)
		{
			this.number[i]=a[i];
		}
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name=name;
	}
	public String getAddress() {
		return address.province+address.city+address.county;
	}
	
	public void setAddress() {
	address=new Address();
	
	}                                                              
	

}
